using System;
using Castle.ActiveRecord;
using CosyTrade.Data;

namespace CosyTrade.Security
{
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [Serializable, ActiveRecord("Role")]
    public class Role : BusinessObject
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        private string roleKey;
        private string roleName;
        private bool isRoleGroup;
        private bool isSystem;
        private bool enable;
        private bool canAssessChildsCompany;
        
        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", Access=PropertyAccess.NosetterCamelcase)]
        public Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        [Property]
        public string RoleKey
        {
            get { return roleKey; }
            set { roleKey = value; }
        }

        [Property]
        public string RoleName
        {
            get { return roleName; }
            set { roleName = value; }
        }

        [Property]
        public bool IsRoleGroup
        {
            get { return isRoleGroup; }
            set { isRoleGroup = value; }
        }

        [Property]
        public bool Enable
        {
            get { return enable; }
            set { enable = value; }
        }

        [Property]
        public bool IsSystem
        {
            get { return isSystem; }
            set { isSystem = value; }
        }

        [Property]
        public bool CanAssessChildsCompany
        {
            get { return canAssessChildsCompany; }
            set { canAssessChildsCompany = value; }
        }

    }
}